package EffectiveJava.chapter3;

import java.util.Arrays;

class Test {

    public static void main(String[] args) throws CloneNotSupportedException {
        PhoneNumber phoneNumber = new PhoneNumber((short) 100, (short) 101, (short) 102);
        PhoneNumber clone = phoneNumber.clone();
        Object[] elements = phoneNumber.getElements();
        elements[0] = 1;
//        System.out.println(phoneNumber.equals(clone));
//        System.out.println(phoneNumber == clone);
        System.out.println(Arrays.toString(phoneNumber.getElements())); //改了一个另一个也随着该了
        System.out.println(Arrays.toString(clone.getElements()));
    }
}
